package com.zhangyu.shadow.ec.main.index;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.listener.SimpleClickListener;
import com.zhangyu.shadow.core.delegate.ShadowDelegate;
import com.zhangyu.shadow.ec.detail.GoodsDetailDelegate;

/**
 * @author zhangyu
 * @date 2017/11/3
 */

public class IndexItemClickListener extends SimpleClickListener {
    private final ShadowDelegate mDelegate;

    private IndexItemClickListener(ShadowDelegate delegate) {
        mDelegate = delegate;
    }

    public static IndexItemClickListener create(ShadowDelegate delegate) {
        return new IndexItemClickListener(delegate);
    }

    @Override
    public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
        mDelegate.start(new GoodsDetailDelegate());
    }

    @Override
    public void onItemLongClick(BaseQuickAdapter adapter, View view, int position) {

    }

    @Override
    public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {

    }

    @Override
    public void onItemChildLongClick(BaseQuickAdapter adapter, View view, int position) {

    }
}
